package com.mlk.waste.api;

import com.mlk.core.util.ServerResponse;
import com.mlk.waste.service.WasteTypeTreeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/WasteType/tree")
public class WasteTypeTreeAPI {

    @Resource
    private WasteTypeTreeService wasteTypeTreeService;


    /**
     * 获取主分类的列表信息
     * @return
     */
    @GetMapping("getMainTypeInfo")
    public ServerResponse getMainTypeInfo(){
        return this.wasteTypeTreeService.getMainTypeInfo();
    }


    /**
     * 获取废品类型的价格信息
     * @param id
     * @return
     */
    @GetMapping("getTypePriceInfo")
    public ServerResponse getTypePriceInfo(Integer id){
        return this.wasteTypeTreeService.getTypePriceInfo(id);
    }

    /**
     * 获取节点的子类型
     * @return
     */
    @GetMapping("getSonTreeNodes")
    public ServerResponse getSonTreeNodes(Integer id){
        return this.wasteTypeTreeService.getSonTreeNodes(id);
    }

}
